package com.github.appintro.example.ui.custom;

import com.github.appintro.AppIntro;
import com.github.appintro.AppIntro2;
import com.github.appintro.AppIntroFragment;
import com.github.appintro.example.ui.ResourceTable;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.utils.Color;
import ohos.utils.PacMap;

public class CustomBackgroundIntro extends AppIntro2 {
    @Override
    public void onStart(Intent savedInstanceState) {
        setLayoutId();
        super.onStart(savedInstanceState);
        this.addSlide(new AppIntroFragment(
                this,
                "Welcome!",
                "This is a demo of the AppIntro library, with a custom background on each slide!",
                ResourceTable.Media_ic_slide1,
                0,
                0,
                0,
                0,
                0,
                null,
                null,
                null
        ));
        this.addSlide(new AppIntroFragment(this,
                "Clean App Intros",
                "This library offers developers the ability to add clean app intros at the start of their apps.",
                ResourceTable.Media_ic_slide2,
                0,
                0,
                0,
                0,
                0,
                null,
                null,
                null
        ));
        this.addSlide(new AppIntroFragment(this,
                "Simple, yet Customizable",
                "The library offers a lot of customization, while keeping it simple for those that like simple.",
                ResourceTable.Media_ic_slide3,
                0,
                0,
                0,
                0,
                0,
                null,
                null,
                null
        ));
        this.addSlide(new AppIntroFragment(this,
                "Explore",
                "Feel free to explore the rest of the library demo!",
                ResourceTable.Media_ic_slide4,
                0,
                0,
                0,
                0,
                0,
                null,
                null,
                null
        ));
        setNextArrowColor(ResourceTable.Color_test_red);
        setSkipArrowColor(ResourceTable.Color_test_blue);
        backgroundResource = ResourceTable.Media_ic_drawer_header;
        setIndicatorColor(ResourceTable.Color_test_bgRed, ResourceTable.Color_test_black);
    }

    public void onSkipPressed(Component currentFragment) {
        super.onSkipPressed(currentFragment);
        terminateAbility();
    }

    public void onDonePressed(Component currentFragment) {
        super.onDonePressed(currentFragment);
        terminateAbility();
    }
}